@PACKAGE_INIT@

include(${CMAKE_CURRENT_LIST_DIR}/mtao-export.cmake)

if (TARGET mtao::common)
  if (NOT TARGET Eigen3::Eigen)
    find_package(Eigen3 QUIET)
    if (NOT Eigen3_FOUND)
      # try with PkgCOnfig
      find_package(PkgConfig REQUIRED)
      pkg_check_modules(Eigen3 QUIET IMPORTED_TARGET eigen3)
    endif()

    if (NOT Eigen3_FOUND)
      message(FATAL_ERROR "Could not find required dependency Eigen3")
      set(MTAO_FOUND FALSE)
    else()
      target_link_libraries(mtao::core INTERFACE PkgConfig::Eigen3)
      set(MTAO_FOUND TRUE)
    endif()
  else()
    target_link_libraries(mtao::core INTERFACE Eigen3::Eigen)
    set(MTAO_FOUND TRUE)
  endif()

endif()

check_required_components(mtao)

